package oopday04;

public class Test {
    public static void main(String[] args) {
        Animal[] animals = new Animal[5];
        animals[0]=new Dog("00",0,"00");
        animals[1]=new Dog("11",1,"11");
        animals[2]=new Dog("22",2,"22");
        animals[3]=new Fish("33",3,"33");
        animals[4]=new Chick("44",4,"44");
        for (int i = 0; i < animals.length; i++) {
            if (animals[i]instanceof Dog){
                Dog dog=(Dog)animals[i];
                dog.lookHome();
                dog.eat();
            }if (animals[i]instanceof Fish){
                Fish fish=(Fish)animals[i];
                fish.swim();
                fish.eat();
            }
            if (animals[i]instanceof Chick){
                Chick chick=(Chick)animals[i];
                chick.eat();
            }
        }

    }
}
